<template>
	<view style="background: #F7F7F7;height: 100vh;">
		<z-paging ref="paging" class="list" v-model="logs" @query="getLogs" default-page-size="10">
			<view class="list-item" v-for="log in logs" :key="log.id">
				<view class="item-top">
					<view class="item-left">
						<view class="t0">{{log.memo}}</view>
						<view class="t1">时间：{{ log.createtime }}</view>
					</view>
					<view class="item-right">
						<view class="t0">{{ log.money }}元</view>
						<view class="t1">余额：{{log.after}}元</view>
					</view>
				</view>
			</view>
		</z-paging>
	</view>
</template>

<script>
	import api from '@/api/index2.js';
	export default {
		data() {
			return {
				logs: []
			};
		},
		onLoad() {},
		methods: {
			getLogs(pageNo, pageSize) {
				api.getMoneylog({
					page:pageNo, 
					limit:pageSize
				}).then(res => {
					this.$refs.paging.complete(res.data.data);
				}).catch(res => {
					this.$refs.paging.complete(false);
				})
			}
		}
	};
</script>

<style lang="scss" scoped>
	.list {
		padding-top: 20rpx;

		.list-item {
			background: #ffffff;
			box-shadow: 0rpx 4rpx 8rpx 0rpx rgba(41, 121, 255, 0.05);
			border-radius: 16rpx;
			border: 2rpx solid;
			border-image: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1)) 1 1;
			margin: 0rpx 34rpx 20rpx;
			padding: 26rpx 30rpx;

			.item-top {
				display: flex;
				align-items: center;
				justify-content: space-between;

				.item-left {
					.t0 {
						font-family: PingFangSC, PingFang SC;
						font-weight: 550;
						font-size: 30rpx;
						color: #413100;
						line-height: 50rpx;
						font-style: normal;
					}

					.t1 {
						font-family: PingFangSC, PingFang SC;
						font-weight: 400;
						font-size: 28rpx;
						color: #666666;
						line-height: 40rpx;
						font-style: normal;
					}
				}

				.item-right {
					.t0 {
						font-family: PingFangSC, PingFang SC;
						font-weight: 600;
						font-size: 32rpx;
						color: #f95452;
						line-height: 44rpx;
						font-style: normal;
						text-align: right;
					}

					.t1 {
						font-family: PingFangSC, PingFang SC;
						font-weight: 400;
						font-size: 28rpx;
						color: #999999;
						line-height: 40rpx;
						font-style: normal;
					}
				}
			}

			.item-bottom {
				.t0 {
					font-family: PingFangSC, PingFang SC;
					font-weight: 400;
					font-size: 28rpx;
					color: #A7A5A5;
					line-height: 40rpx;
				}
			}
		}
	}
</style>